package main

import "fmt"

// CalcHandler Calc service handler
type CalcHandler struct{}

// NewCalcHandler get a new handler for service
func NewCalcHandler() *CalcHandler {
	return &CalcHandler{}
}

// Ping IMPL Ping interface
func (p *CalcHandler) Ping() (string, error) {
	fmt.Println("DEBUG: client ping server!")
	return "Pong", nil
}

// Add IMPL Add interface
func (p *CalcHandler) Add(num1 int32, num2 int32) (int32, error) {
	return num1 + num2, nil

}

// Sub IMPL Subinterface
func (p *CalcHandler) Sub(num1 int32, num2 int32) (int32, error) {
	return num1 - num2, nil
}
